﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Security.Cryptography;

namespace LY.Manage.Common
{
   public class WebCommon
    {
       public static string GetMd5String(string str)
       {
           MD5 md5 = MD5.Create();
           byte[] buffer = Encoding.UTF8.GetBytes(str);
           byte[] md5Buffer = md5.ComputeHash(buffer);
           StringBuilder sb = new StringBuilder();
           foreach (byte b in md5Buffer)
           {
               sb.Append(b.ToString("x2"));
           }
           md5.Clear();
           return sb.ToString();
       }
    }
}
